package com.logic.landseaserver.ws.dto;

import java.sql.Timestamp;
import java.util.Date;
import java.util.List;

import com.logic.system.domain.SystemFile;
/**
 * @Author: jack
 * @Date: 2017/5/23
 * @Description: 账单支付类
 */
public class BillPaymentDTO {

   //如果是编辑的话，必须包含id
	private Integer id;//活动id
	
	//基本信息
	private Integer billId;
	
	private String payType;

	private String payTypeName;
	
	private Date time;

	private Double money;

	private String transactionNo;

	private String orderNo;
	
	private String bank;

	private String status;
	
	private String statusName;
	
	private String imageId;
	
	private String billType;

	private Integer createdBy;
	
	private Date createdDtm;

	private Date lastModifiedDtm;

	private Integer lastModifiedBy;

	private Integer version;

	private Boolean deleted;

	private String comments;
	//凭证图片对象
	private List<SystemFile> imagePath;
	
    /** 是否需要校验金额 **/
    private boolean isNeedCheckMoney = true;
	
	public List<SystemFile> getImagePath() {
		return imagePath;
	}

	public void setImagePath(List<SystemFile> imagePath) {
		this.imagePath = imagePath;
	}
	
	//基本信息
	private Integer userId;//用户ID（管理员/用户）
	
	public Date getCreatedDtm() {
		return createdDtm;
	}

	public void setCreatedDtm(Date createdDtm) {
		this.createdDtm = createdDtm;
	}

	public Integer getUserId() {
		return userId;
	}

	public void setUserId(Integer userId) {
		this.userId = userId;
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}
	public Integer getBillId() {
		return billId;
	}

	public void setBillId(Integer billId) {
		this.billId = billId;
	}

	public String getPayType() {
		return payType;
	}

	public void setPayType(String payType) {
		this.payType = payType;
	}

	public Date getTime() {
		return time;
	}

	public void setTime(Date time) {
		this.time = time;
	}

	public Double getMoney() {
		return money;
	}

	public void setMoney(Double money) {
		this.money = money;
	}

	public String getTransactionNo() {
		return transactionNo;
	}

	public void setTransactionNo(String transactionNo) {
		this.transactionNo = transactionNo;
	}

	public String getOrderNo() {
		return orderNo;
	}

	public void setOrderNo(String orderNo) {
		this.orderNo = orderNo;
	}

	public String getBank() {
		return bank;
	}

	public void setBank(String bank) {
		this.bank = bank;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public String getImageId() {
		return imageId;
	}

	public void setImageId(String imageId) {
		this.imageId = imageId;
	}

	public String getBillType()
    {
        return billType;
    }

    public void setBillType(String billType)
    {
        this.billType = billType;
    }

    public Integer getCreatedBy() {
		return createdBy;
	}

	public void setCreatedBy(Integer createdBy) {
		this.createdBy = createdBy;
	}

	public Date getLastModifiedDtm() {
		return lastModifiedDtm;
	}

	public void setLastModifiedDtm(Date lastModifiedDtm) {
		this.lastModifiedDtm = lastModifiedDtm;
	}

	public Integer getLastModifiedBy() {
		return lastModifiedBy;
	}

	public void setLastModifiedBy(Integer lastModifiedBy) {
		this.lastModifiedBy = lastModifiedBy;
	}

	public Integer getVersion() {
		return version;
	}

	public void setVersion(Integer version) {
		this.version = version;
	}

	public Boolean getDeleted() {
		return deleted;
	}

	public void setDeleted(Boolean deleted) {
		this.deleted = deleted;
	}
	
	public String getPayTypeName() {
		return payTypeName;
	}

	public void setPayTypeName(String payTypeName) {
		this.payTypeName = payTypeName;
	}
	
	public String getStatusName() {
		return statusName;
	}

	public void setStatusName(String statusName) {
		this.statusName = statusName;
	}

	public String getComments() {
		return comments;
	}

	public void setComments(String comments) {
		this.comments = comments;
	}

	public void updateCommonInfo(Integer userId) {

      Timestamp now = new Timestamp(new Date().getTime());
      if (this.getId() == null || this.getId() == 0) { // New PoJo
        this.setVersion(0);
        if (this.getCreatedDtm() == null) {
          this.setCreatedDtm(now);
        }
        if (this.getCreatedBy() == null || this.getCreatedBy().equals(0)) {
          this.setCreatedBy(userId == null ? 0 : userId);
        }
        this.setLastModifiedDtm(now);
        this.setLastModifiedBy(userId == null ? 0 : userId);
        this.setDeleted(false);

      } else { // Update this
        this.setVersion(this.getVersion() == null ? 1 : this.getVersion() + 1);
        this.setLastModifiedDtm(now);
        if (userId.equals(-1)) {
        } else {
          this.setLastModifiedBy(userId == null ? 0 : userId);
        }
      }
    }
	
    public boolean isNeedCheckMoney()
    {
        return isNeedCheckMoney;
    }

    public void setNeedCheckMoney(boolean isNeedCheckMoney)
    {
        this.isNeedCheckMoney = isNeedCheckMoney;
    }

    /**    
     * [描述]：</br>
     *
     * @return
     *
    */
    @Override
    public String toString()
    {
        return "BillPaymentDTO [id=" + id + ", billId=" + billId + ", payType=" + payType + ", payTypeName="
            + payTypeName + ", time=" + time + ", money=" + money + ", transactionNo=" + transactionNo + ", orderNo="
            + orderNo + ", bank=" + bank + ", status=" + status + ", statusName=" + statusName + ", imageId=" + imageId
            + ", billType=" + billType + ", createdBy=" + createdBy + ", createdDtm=" + createdDtm
            + ", lastModifiedDtm=" + lastModifiedDtm + ", lastModifiedBy=" + lastModifiedBy + ", version=" + version
            + ", deleted=" + deleted + ", comments=" + comments + ", imagePath=" + imagePath + ", isNeedCheckMoney="
            + isNeedCheckMoney + ", userId=" + userId + "]";
    }
}
